<?php

namespace app\common\model;

use traits\model\SoftDelete;

class Activity extends Model
{

    use SoftDelete;


    // 表名
    protected $name = 'activity';


    // 追加属性
    protected $append = [

    ];

    public function user()
    {
        return $this->hasMany(\app\common\model\user\Activity::class, 'activity_id', 'id');
    }

    public function userCount()
    {
        return $this->hasMany(\app\common\model\user\Activity::class, 'activity_id', 'id')->where('status', \app\common\model\user\Activity::STATUS_SUCC);
    }
}
